<template>
  <div
    :class="[
      'bw-design-create',
      isPcFront ? 'bw-design-pc' : 'bw-design-mobile',
    ]"
    ref="desiginCreate"
  >
    <BwNodeTool ref="tool" :get-container="getContainer" />

    <component v-if="myEle" ref="dEle" :is="myEle" />
  </div>
</template>

<script lang="ts" setup>
import { useCreate } from './util'
import BwNodeTool from './coms/tool/index.vue'

const { myEle, isPcFront, desiginCreate, getContainer } = useCreate()
</script>

<style lang="less" scoped>
.bw-design-create {
  margin: 16px;
  border-radius: 5px;
  width: calc(100% - 32px);
  height: calc(100% - 32px - 36px);
  background-color: #ffffff;
  position: relative;

  /** 暴露设计模式下画板中的表格插槽 */
  :deep(.vxe-table-slots) {
    display: block !important;
  }
}

.bw-design-pc {
  width: calc(100% - 32px);
}

.bw-design-mobile {
  width: 350px;
  margin: auto;
}
</style>
